<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />
		
		<title>JsDoc Reference - xpAjax</title>

        <link rel="stylesheet" href="../static/default.css" type="text/css" media="screen" charset="utf-8" />
	</head>

	<body>
<!-- ============================== header ================================= -->	
		<!-- begin static/header.html -->
		<div id="header">
</div>
		<!-- end static/header.html -->

        

<!-- ============================== classes index ============================ -->
		<div id="index">
            <div id="docs">
                
            </div>
			
<h2>Index</h2>
<ul class="classList">
  <li><a href="../files.html">File Index</a></li>
  <li><a href="../index.html">Class Index</a></li>
  <li><a href="../symbolindex.html">Symbol Index</a></li>
</ul>
<h2>Classes</h2>
<ul class="classList">
	
	<li><a href="../symbols/xpAjax.html">xpAjax</a></li>
	
</ul>

		</div>
		
        <div id="symbolList">
           <!-- constructor list -->
           
             <h3>
                 Namespace 
             </h3>
             <ul>
                <li >
                  <a href="../symbols/xpAjax.html">xpAjax</a>
                </li>
             </ul>
           
           <!-- end constructor list -->

           <!-- properties list -->
           
           
             <h3>Variables</h3>
             <ul>
               
                 <li>
                   <a href="../symbols/xpAjax.html#_fieldvalue">_fieldvalue</a>
                 </li>
               
                 <li>
                   <a href="../symbols/xpAjax.html#_formvalues">_formvalues</a>
                 </li>
               
                 <li>
                   <a href="../symbols/xpAjax.html#_uservalues">_uservalues</a>
                 </li>
               
                 <li>
                   <a href="../symbols/xpAjax.html#-serverRepository">serverRepository</a>
                 </li>
               
             </ul>
           
           <!-- end properties list -->

           <!-- function summary -->
           
           
             <h3>Functions</h3>
             <ul>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-addProperty">addProperty</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-createParmsFromField">createParmsFromField</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-createParmsFromForm">createParmsFromForm</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-createrequest">createrequest</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-evaluate">evaluate</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-replaceAll">replaceAll</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#send">send</a>
                    </li>
               
                   <li>
                        <a href="../symbols/xpAjax.html#-xmlhttprequest">xmlhttprequest</a>
                    </li>
               
             </ul>
           
           <!-- end function summary -->

           <!-- events summary -->
           
           
           <!-- end events summary -->
        </div>

		<div id="content">
<!-- ============================== class title ============================ -->
			<h1 class="classTitle">
				xpAjax
			</h1>

<!-- ============================== class summary ========================== -->			
			<p class="description">
				<i>Author: </i>
					<a href='https://sites.google.com/site/rlrossi'>Ricardo Luiz Rossi at sites.google.com/site/rlrossi</a>
					<br /><a href='mailto:rlrossi@gmail.com'>rlrossi@gmail.com</a>
					<br />Version 1.00.000<br />
				
				
			
				
				
				
				
			</p>

<!-- ============================== constructor details ==================== -->		
			
			<div class="details"><a name="constructor"> </a>
				<div class="sectionTitle">
					Constructor Detail
				</div>
				
				<div class="fixedFont">
						<b>xpAjax</b>
				</div>
				
				<div class="description">
					<p>xpAjax - e<b>XP</b>ress <b>AJAX</b> Javascript Class<br />
Deals with the various details of AJAX calling (such as create the proper XMLHttpRequest
    for the browser/version in use) and process the results, making very simple to implement AJAX
    requests and result evaluation.</p>
				</div>
				
				
				
				
					
						<dl class="detailList">
						<dt class="heading">Parameters:</dt>
						
							<dt>
								<span class="light fixedFont">{String}</span>  <b>repository</b>
								
							</dt>
								<dd>The root URL where to find the servers' scripts for the current instance 
    of the ajax object</dd>
						
						</dl>
					
					
					
					
					
						<dl class="detailList">
						<dt class="heading">Returns:</dt>
						
								<dd>void</dd>
						
						</dl>
					
					
					

			</div>
			

<!-- ============================== field details ========================== -->		
			
              <div class="details">
				<div class="sectionTitle">
					Field Detail
				</div>
				
                  <div class="member">
					<a name="_fieldvalue"> </a>
					<div class="fixedFont">
                      <div class="modifiers">
                      </div>
					
					<span class="light">{Constant:Value = 2}</span>
					<b>_fieldvalue</b>
					
					</div>
					<div class="description">
						<p>A single AJAX server parameter should be loaded from an indicated fieldid</p>
						
						
					</div>
					
					

						
						
						
						
                  </div>
				
                  <div class="member">
					<a name="_formvalues"> </a>
					<div class="fixedFont">
                      <div class="modifiers">
                      </div>
					
					<span class="light">{Constant:Value = 1}</span>
					<b>_formvalues</b>
					
					</div>
					<div class="description">
						<p>AJAX Server parameters should be loaded from the fields of an indicated formid</p>
						
						
					</div>
					
					

						
						
						
						
                  </div>
				
                  <div class="member">
					<a name="_uservalues"> </a>
					<div class="fixedFont">
                      <div class="modifiers">
                      </div>
					
					<span class="light">{Constant:Value = 0}</span>
					<b>_uservalues</b>
					
					</div>
					<div class="description">
						<p>AJAX Server parameters will be supplied by the user</p>
						
						
					</div>
					
					

						
						
						
						
                  </div>
				
                  <div class="member">
					<a name="-serverRepository"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;inner&gt; 
                      </div>
					
					<span class="light">{String:copy of the constructor's repository parameter}</span>
					<b>serverRepository</b>
					
					</div>
					<div class="description">
						<p>The root URL where to find the scripts to be called by the current instance of the ajax object</p>
						
						
					</div>
					
					

						
						
						
						
                  </div>
				
              </div>
			

<!-- ============================== method details ========================= -->		
			
              <div class="details">
				<div class="sectionTitle">
					Method Detail
				</div>
				
                  <div class="member">
					<a name="-addProperty"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{String}</span>
					<b>addProperty</b>(id, value)
					
					</div>
					<div class="description">
						<p>Add a property to json's ajax query String</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>id</b>
									
								</dt>
								<dd>The id of the property</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>value</b>
									
								</dt>
								<dd>The value of the property</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> Formatted JSON String of the property as of "id":value</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-createParmsFromField"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{String}</span>
					<b>createParmsFromField</b>(fieldid)
					
					</div>
					<div class="description">
						<p>Creates a JSON like parameter to be used in the AJAX call from a supplied form 
    field ID using addProperty Method</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>fieldid</b>
									
								</dt>
								<dd>The id of the form field We wish to use as AJAX parameter</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> addProperty's formatted JSON String</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-createParmsFromForm"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{String}</span>
					<b>createParmsFromForm</b>(formid)
					
					</div>
					<div class="description">
						<p>Creates a JSON like parameter to be used in the AJAX call by iterating all elements
    of a supplied form ID using addProperty Method</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>formid</b>
									
								</dt>
								<dd>The id of the form We wish all it's elements in the AJAX parameter</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> addProperty's formatted JSON String</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-createrequest"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{String}</span>
					<b>createrequest</b>(script, parameters)
					
					</div>
					<div class="description">
						<p>Creates the AJAX complete request URL to be used in an AJAX.GET calls with the script
    to be called and it's parameters</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>script</b>
									
								</dt>
								<dd>The script name that could be found in the serverRepository property</dd>
							
								<dt>
									<span class="light fixedFont">{string}</span> <b>parameters</b>
									
								</dt>
								<dd>The parameters to be sent in the script's URL</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> The complete and formatted AJAX request URL so We can use it in an AJAX.GET call</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-evaluate"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{Mixed}</span>
					<b>evaluate</b>(evalString)
					
					</div>
					<div class="description">
						<p>Evaluates a String into a Javascript code</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>evalString</b>
									
								</dt>
								<dd>The String containning the javascript code to be evaluated</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Mixed}</span> The result of the evaluated Javascript-code-String <b>OR</b>, if an error
    occurs, a JSON object describing this error with the following properties:
    <br />{"error":8,"msg":"The error message","src":"The supplied evalString"}</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-replaceAll"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{String}</span>
					<b>replaceAll</b>(source, search, replacement)
					
					</div>
					<div class="description">
						<p>replaces all ocurrences of an String pattern with another one</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>source</b>
									
								</dt>
								<dd>The source String where to search for a pattern</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>search</b>
									
								</dt>
								<dd>The pattern to be searched for</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>replacement</b>
									
								</dt>
								<dd>The replacement String to be used as substitution when search pattern is found</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> The source string replaced</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="send"> </a>
					<div class="fixedFont">
                      <div class="modifiers">
                      </div>
					<span class="light">{void}</span>
					<b>send</b>(Script, callBack, Parameters)
					
					</div>
					<div class="description">
						<p>Executes an AJAX request URL to be used in an AJAX.GET calls with the script to be called and 
    it's parameters</p>
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>Script</b>
									
								</dt>
								<dd>The script name of the AJAX processor that should be called, which can
    be found in the 'serverRepository' property</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>callBack</b>
									
								</dt>
								<dd>The function name that will be called to deal with the results when 
    AJAX processing is done.<br />
    Optionaly the word <i>'discard'</i> can be used as a callback function name, when We dont't
    need to process the results and all We have to do is to discard the results of the AJAX call.</dd>
							
								<dt>
									<span class="light fixedFont">{string}</span> <b>Parameters</b>
									
								</dt>
								<dd>A JSON string with the parameters to AJAX processos in the format:
    <br />&nbsp;&nbsp;&nbsp;&nbsp;{"sourceparms":"Type","p1":value,..."pn":value)
    <br />Being 'Type' one of the constants '_formvalues', '_fieldvalue' or '_uservalues'
    described above.
<br /><br />For <b>'_uservalues'</b> Type, the class expects a list of users's parameters.
    <br /><i>Ex.: {"sourceparms":+xpAjax._uservalues+,"p1":1,"p2":"2"}</i>
<br /><br />For <b>'_fieldvalue'</b> Type, the class expects a JSON property called 'objectid'
    indicating the FIELD-ID in the current document to find the parameter.
    <br /><i>Ex.: {"sourceparms":+xpAjax._fieldvalue+,"objectid":"phone"}</i>
<br /><br />For <b>'_formvalues'</b> Type, the class expects a JSON property called 'objectid'
    <br />indicating the FORM-ID in the current document to find the parameters.
    <br /><i>Ex.: {"sourceparms":+xpAjax._formvalues+,"objectid":"books"}</i></dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{void}</span> The callBack function will be called to deal with the results <b>OR</b>, 
    if an error occurs, a JSON object describing the error with the following properties:
    <br />{"error":9,"msg":"The error message","src":"The result of the AJAX call"}</dd>
							
							</dl>
						
						
						

                  </div>
				
                  <div class="member">
					<a name="-xmlhttprequest"> </a>
					<div class="fixedFont">
                      <div class="modifiers">&lt;private&gt; &lt;inner&gt; 
                      </div>
					<span class="light">{Object}</span>
					<b>xmlhttprequest</b>()
					
					</div>
					<div class="description">
						<p>Instantiate a proper XMLHttpRequest by trying the most known browsers XMLHttpRequest libraries</p>
						
						
					</div>
					
					
					
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{XMLHttpRequestError}</span>  <b></b>
								</dt>
								<dd>A message indicating that We were unable to find a proper
XMLHttpRequest library for this session</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Object}</span> The object linked to the XMLHttpRequest instantiated</dd>
							
							</dl>
						
						
						

                  </div>
				
              </div>
			
			
<!-- ============================== event details ========================= -->		
			
			<hr />
		</div>

		
<!-- ============================== footer ================================= -->
		<div class="fineprint" style="clear:both;text-align:center">
			
			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Fri Feb 22 2013 22:54:24 GMT-0300 (BRT)
		</div>
	</body>
</html>
